<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>增加客服配置</title>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="stylesheet" href="../../../component/elementUI/index.css" />
    <link rel="stylesheet" href="../../../style/index.css" />
  </head>

  <body>
    <div id="app" class="minWidth">
      <el-form ref="contract" inline-message="true" style="width: 100%">
        <div class="table_titel">
          <div class="titel">爬虫配置</div>
          <div class="operation">
            <el-button type="primary" size="small" @click="add_reptile_config"
              >添加</el-button
            >
            <el-button type="danger" size="small" @click="delet_reptile_config"
              >删除</el-button
            >
          </div>
        </div>
        <div
          style="margin-bottom: 10px"
          v-for="(item,index) in reptile_config"
          :key="index"
        >
          <div v-if="index" class="table_titel">
            <div class="titel">{{index+1}}级解析</div>
          </div>
          <el-descriptions :column="3" border size="small">
            <!-- <el-descriptions-item label="解析格式">
                        <el-form-item prop="Reptile_Class">
                            <el-input type="textarea" autosize placeholder="请输入解析格式" v-model.trim="item.Reptile_Class"></el-input>
                        </el-form-item>
                    </el-descriptions-item> -->
            <el-descriptions-item v-if="!index" label="目标URL">
              <el-form-item prop="URL">
                <el-input
                  v-model.trim="item.URL"
                  placeholder="请输入目标URL"
                ></el-input>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item label="类型">
              <el-form-item prop="item.News_Type">
                <el-select
                  v-model.trim="item.News_Type"
                  placeholder="请选择类型"
                  filterable
                  style="width: 100%"
                >
                  <el-option
                    v-for="(item,index) in Reptile_Type"
                    :key="index"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item label="栏目分类">
              <el-form-item>
                <el-cascader
                  v-model="type"
                  :options="options"
                  :props="props"
                  placeholder="请选择栏目分类"
                  clearable
                  style="width: 100%"
                ></el-cascader>
              </el-form-item>
            </el-descriptions-item>
          </el-descriptions>
        </div>
        <div class="table_titel">
          <div class="titel">新闻循环列表配置</div>
          <div class="operation">
            <el-button
              type="primary"
              size="small"
              @click="add_reptile_config_detail"
              >添加</el-button
            >
            <el-button
              type="danger"
              size="small"
              @click="delet_reptile_config_detail"
              >删除</el-button
            >
          </div>
        </div>
        <el-descriptions
          v-for="(item,index) in reptile_config_detail"
          :key="index"
          style="margin-bottom: 10px"
          :column="2"
          border
          size="small"
        >
          <!--                <el-descriptions-item label="解析格式">
                    <el-form-item prop="Reptile_Detail_Class">
                        <el-input type="textarea" autosize placeholder="请输入解析格式" v-model.trim="item.Reptile_Detail_Class"></el-input>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="获取格式">
                    <el-form-item prop="Reptile_Detail_Type">
                      <el-input v-model.trim="item.Reptile_Detail_Type" placeholder="请输入获取格式"></el-input>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="排除项">
                    <el-form-item prop="Reptile_Detail_Eliminate">
                        <el-input type="textarea" autosize placeholder="可输入排除项，多个用;间隔" v-model.trim="item.Reptile_Detail_Eliminate"></el-input>
                    </el-form-item>
                </el-descriptions-item> -->
          <el-descriptions-item label="type1">
            <el-form-item prop="type1">
              <el-input
                type="textarea"
                autosize
                placeholder="可输入排除项，多个用;间隔"
                v-model="item.type1"
              ></el-input>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item label="value1">
            <el-form-item prop="value1">
              <el-input
                type="textarea"
                autosize
                placeholder="可输入排除项，多个用;间隔"
                v-model="item.value1"
              ></el-input>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item label="class1">
            <el-form-item prop="class1">
              <el-input
                type="textarea"
                autosize
                placeholder="可输入排除项，多个用;间隔"
                v-model="item.class1"
              ></el-input>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item label="number">
            <el-form-item prop="number">
              <el-input
                type="textarea"
                autosize
                v-model="item.number"
              ></el-input>
            </el-form-item>
          </el-descriptions-item>
        </el-descriptions>
        <div class="table_titel">
          <div class="titel">新闻循环列表元素配置</div>
          <div class="operation">
            <el-button
              type="primary"
              size="small"
              @click="add_reptile_config_detail_element"
              >添加</el-button
            >
            <el-button
              type="danger"
              size="small"
              @click="delet_reptile_config_detail_element"
              >删除</el-button
            >
          </div>
        </div>
        <el-descriptions
          v-for="(item,index) in reptile_config_detail_element"
          :key="index"
          :style="reptile_config_detail.length-1==index?'margin-bottom: 100px;':'margin-bottom: 10px;'"
          :column="2"
          border
          size="small"
        >
          <el-descriptions-item label="type2">
            <el-form-item prop="type2">
              <el-input
                type="textarea"
                autosize
                placeholder="可输入排除项，多个用;间隔"
                v-model="item.type2"
              ></el-input>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item label="value2">
            <el-form-item prop="value2">
              <el-input
                type="textarea"
                autosize
                placeholder="可输入排除项，多个用;间隔"
                v-model="item.value2"
              ></el-input>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item label="class2">
            <el-form-item prop="class2">
              <el-input
                type="textarea"
                autosize
                placeholder="可输入排除项，多个用;间隔"
                v-model="item.class2"
              ></el-input>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item label="img">
            <el-form-item prop="img">
              <el-input
                type="textarea"
                autosize
                placeholder=""
                v-model="item.img"
              ></el-input>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item label="imgValue">
            <el-form-item prop="imgValue">
              <el-input
                type="textarea"
                autosize
                placeholder=""
                v-model="item.imgValue"
              ></el-input>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item label="href">
            <el-form-item prop="href">
              <el-input
                type="textarea"
                autosize
                placeholder=""
                v-model="item.href"
              ></el-input>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item label="content">
            <div class="operation" style="margin-bottom: 10px">
              <el-button
                type="primary"
                size="small"
                @click="add_reptile_config_detail_element_content(index)"
                >添加</el-button
              >
              <el-button
                type="danger"
                size="small"
                @click="delet_reptile_config_detail_element_content(index)"
                >删除</el-button
              >
            </div>
            <el-descriptions
              v-for="(tm,idx) in item.content"
              :key="idx"
              :column="2"
              border
              size="small"
              style="margin-bottom: 10px"
            >
              <el-descriptions-item label="题头">
                <el-form-item :prop="'tm.'+idx+'.title'">
                  <el-input
                    type="textarea"
                    autosize
                    placeholder=""
                    v-model="tm.title"
                  ></el-input>
                </el-form-item>
              </el-descriptions-item>
              <el-descriptions-item label="内容">
                <el-form-item :prop="'tm.'+idx+'.content'">
                  <el-input
                    type="textarea"
                    autosize
                    placeholder=""
                    v-model="tm.content"
                  ></el-input>
                </el-form-item>
              </el-descriptions-item>
            </el-descriptions>
          </el-descriptions-item>
        </el-descriptions>
        <el-form-item class="form-operation">
          <el-button @click="window.history.back()">返回</el-button>
          <el-button
            type="primary"
            :loading="loading"
            @click="submitForm('contract')"
            >提交</el-button
          >
        </el-form-item>
      </el-form>
    </div>
    <script
      type="text/javascript"
      src="../../../utils/jquery-3.6.0.min.js"
    ></script>
    <script
      type="text/javascript"
      src="../../../utils/jquery.cookie.js"
    ></script>
    <script type="text/javascript" src="../../../utils/vue.min.js"></script>
    <script
      type="text/javascript"
      src="../../../component/elementUI/index.js"
    ></script>
    <script type="text/javascript" src="../../../utils/utils.js"></script>
    <script type="text/javascript" src="../../../config/config.js"></script>
    <script type="text/javascript" src="../../../utils/ID_Validity.js"></script>
    <script type="text/javascript" src="../../../utils/compressor.js"></script>
    <script type="text/javascript" src="./js/Add.js"></script>
    <script>
      // new Vue({
      //   el: "#app",
      //   data() {
      //     return {};
      //   },
      //   methods: {

      //     },
      // });
    </script>
  </body>
</html>
